package com.wocao.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wocao.entity.ZyComplaintSuggest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 投诉建议  Mapper 接口
 * </p>
 *
 * @author cwj
 * @since 2023-11-29
 */
public interface ZyComplaintSuggestMapper extends BaseMapper<ZyComplaintSuggest> {

    //查询所有
    Page<ZyComplaintSuggest> selectComplaintAll(Page page, @Param("complaintType") String complaintType);

    @Update("UPDATE zy_complaint_suggest set complaint_status = '1' where complaint_suggest_id = #{comId}")
    //更新投诉状态
    void editComplaintStatus(String comId);


    //小程序-根据业主id查询投诉建议
//    @Select("SELECT * FROM `zy_complaint_suggest` where user_id = #{userId}")
    List<ZyComplaintSuggest> selectAllByOwnerId(@Param("userId") String userId,@Param("comType") String comType);
}
